<template>
	<view class="page">
		<!-- 头部背景图 -->
		<view class="pageTopImg" :style="'padding-top:' + touHeight + 'px'"></view>
		<!-- 顶部菜单 -->
		<view class="topHeader" :style="'height:' + touHeight +'px;'">
			<view class="fanhuiUp" @tap="toFanhuiUp"></view>
			<view class="pageTitle">提现</view>
		</view>
		<view class="page_content" :style="'padding-top:' + touHeight + 'px'">
			<form @submit="submitForm" class="submitForm">
				<view class="input_list" style="margin-top: 0px;">
					<view class="details_name">提现金额</view>
					<view class="input_box">
						<view class="name">￥</view>
						<input type="number" name="formMoney" :value="formMoney" placeholder-class="phcolor" @input="inputMoney" placeholder="请填写提现金额"/>
					</view>
				</view>
				<view class="tixian_bottom">
					<view class="name">提现到</view>
					<view class="text">1999.20<view class="allTixian" @tap="allTixian" data-no="1999.20">全部提现</view></view>
				</view>
				<view class="tips">
					<view>温馨提示：</view>
					<view>1、余额会自动提现到当前微信账号的微信钱包；</view>
					<view>2、如遇到网络原因可能会存在延迟，请留意微信消息提醒；</view>
				</view>
				<view class="public_btn public_btn03" @tap="tixianBtn">提 现</view>
			</form>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				//域名拼接
				URL: app.globalData.URL,
				touHeight: 0,
				formMoney:''
			}
		},
		
		onLoad(options){
			var that = this;
			//自定义头部高度
			app.customNav()
			that.touHeight = app.touHeight + 5//搜索栏距离顶部高度
		},
		methods: {
			//返回上一级
			toFanhuiUp:function(){
				uni.navigateBack({
				    delta: 1
				})
			},
			
			//提现金额实时监控
			inputMoney:function(e){
				var that = this;
				that.formMoney = e.detail.value;
			},
			
			//全部提现传值给input
			allTixian: function(e){
				var that = this;
				that.formMoney = e.currentTarget.dataset.no;
			},
			
			//提现效果
			tixianBtn:function() {
				var that = this;
				var formMoney = that.formMoney;
				console.log(formMoney)
				if(formMoney==undefined||formMoney==0){
					uni.showModal({
						title: '提示',
						content: '提现金额不能为空',
						showCancel: false,
						confirmColor:'#E85426',
					})
				}else{
					uni.showModal({
						title: '提示',
						content: '确定要提现吗？',
						showCancel: true,
						confirmColor:'#E85426',
						success (res) {
							if (res.confirm) {
								
							}
						}
					})
				}
			},
		}
	}
</script>

<style>
	.page_content{
		padding: 0px;
	}
	.submitForm .input_list{
		height: auto;
	}
	.details_name:after{
		top: 50%;
		margin-top: -16rpx;
	}
</style>
